import 'package:effective/model/result_entity.dart';
import 'package:effective/model/user_entity.dart';
import 'package:effective/service/api.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:provider/provider.dart';

import '../model/result_entity.dart';
import '../model/result_entity.dart';
import '../view_model/upload_viewmodel.dart';
import '../view_model/upload_viewmodel.dart';
import '../view_model/upload_viewmodel.dart';
import '../view_model/upload_viewmodel.dart';

class CommonDialog {
  TextStyle textStyle = TextStyle(
    fontWeight: FontWeight.w600,
    fontSize: 20,
  );

  Future<ResultEntity> loginDialog(BuildContext context,) async {
    TextEditingController email = new TextEditingController();
    TextEditingController password = new TextEditingController();
    return showDialog<ResultEntity>(
        context: context,
        builder: (context) {
          return AlertDialog(
            contentPadding: EdgeInsets.zero,
            content: Container(
              margin: EdgeInsets.fromLTRB(168, 20, 168, 0),
              width: 650,
              height: 480,
              child: Column(
                children: [
                  Container(
                    margin: EdgeInsets.only(top: 5),
                    child: SvgPicture.asset('assets/security.svg'),
                  ),
                  Container(
                    margin: EdgeInsets.only(top: 20),
                    child: Text(
                      'Login Your Account to E-ffective',
                      style: TextStyle(
                          color: Colors.black,
                          fontWeight: FontWeight.w500,
                          fontSize: 24),
                    ),
                  ),
                  Container(
                    margin: EdgeInsets.only(top: 20),
                    width: double.infinity,
                    height: 50,
                    decoration: BoxDecoration(
                        border: Border.all(color: Colors.black, width: 2),
                        borderRadius: BorderRadius.circular(10)),
                    child: TextField(
                      controller: email,
                      maxLines: 1,
                      decoration: InputDecoration(
                          hintText: '请输入你的邮箱',
                          border: InputBorder.none,
                          contentPadding: EdgeInsets.fromLTRB(10, 12, 0, 10),
                          suffixIcon: Icon(
                            Icons.person_outline,
                            size: 24,
                          )),
                      style: TextStyle(fontSize: 18),
                      cursorHeight: 24,
                    ),
                  ),
                  Container(
                    margin: EdgeInsets.only(top: 20),
                    width: double.infinity,
                    height: 50,
                    decoration: BoxDecoration(
                        border: Border.all(color: Colors.black, width: 2),
                        borderRadius: BorderRadius.circular(10)),
                    child: TextField(
                      obscureText: true,
                      controller: password,
                      maxLines: 1,
                      decoration: InputDecoration(
                          hintText: '请输入你的密码',
                          border: InputBorder.none,
                          contentPadding: EdgeInsets.fromLTRB(10, 12, 0, 10),
                          suffixIcon: Icon(
                            Icons.lock_outline,
                            size: 24,
                          )),
                      style: TextStyle(fontSize: 18),
                      cursorHeight: 24,
                    ),
                  ),
                  Container(
                    margin: EdgeInsets.only(top: 20),
                    width: double.infinity,
                    height: 50,
                    child: TextButton(
                      onPressed: () async {
                        ResultEntity resultEntity = await API().login(
                            UserEntity().fromJson({
                              "email": email.text.trim(),
                              "password": password.text.trim()
                            }));
                        if (resultEntity.code == 200) {
                          Fluttertoast.showToast(
                              msg: "登录成功", gravity: ToastGravity.BOTTOM);
                          Map resultData = new Map();
                          resultData['token'] = resultEntity.data;
                          resultData['username'] = email.text.trim();
                          Navigator.of(context)
                              .pop(ResultEntity.success(resultData));
                        } else {
                          Fluttertoast.showToast(
                              msg: resultEntity.message,
                              gravity: ToastGravity.BOTTOM);
                        }
                        // Navigator.of(context).pop(resultEntity);
                      },
                      child: Text(
                        '登录',
                        style: TextStyle(color: Colors.white, fontSize: 20),
                      ),
                      style: ButtonStyle(
                        shape: MaterialStateProperty.resolveWith((states) {
                          return new RoundedRectangleBorder(
                              borderRadius: new BorderRadius.circular(10.0));
                        }),
                        backgroundColor:
                        MaterialStateProperty.resolveWith((states) {
                          return Color(0xFF00B6FF);
                        }),
                      ),
                    ),
                  )
                ],
              ),
            ),
            shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(29.0))),
          );
        });
  }

  Future<ResultEntity> registerDialog(BuildContext context,) async {
    TextEditingController email = new TextEditingController();
    TextEditingController password = new TextEditingController();
    TextEditingController confirm = new TextEditingController();
    return showDialog<ResultEntity>(
        context: context,
        builder: (context) {
          return AlertDialog(
            contentPadding: EdgeInsets.zero,
            content: Container(
              margin: EdgeInsets.fromLTRB(168, 20, 168, 0),
              width: 650,
              height: 480,
              child: Column(
                children: [
                  Container(
                    margin: EdgeInsets.only(top: 5),
                    child: SvgPicture.asset('assets/security.svg'),
                  ),
                  Container(
                    margin: EdgeInsets.only(top: 20),
                    child: Text(
                      'Create Your Account to E-ffective',
                      style: TextStyle(
                          color: Colors.black,
                          fontWeight: FontWeight.w500,
                          fontSize: 24),
                    ),
                  ),
                  Container(
                    margin: EdgeInsets.only(top: 20),
                    width: double.infinity,
                    height: 50,
                    decoration: BoxDecoration(
                        border: Border.all(color: Colors.black, width: 2),
                        borderRadius: BorderRadius.circular(10)),
                    child: TextField(
                      controller: email,
                      maxLines: 1,
                      decoration: InputDecoration(
                          hintText: '请输入你的邮箱',
                          border: InputBorder.none,
                          contentPadding: EdgeInsets.fromLTRB(10, 12, 0, 10),
                          suffixIcon: Icon(
                            Icons.person_outline,
                            size: 24,
                          )),
                      style: TextStyle(fontSize: 18),
                      cursorHeight: 24,
                    ),
                  ),
                  Container(
                    margin: EdgeInsets.only(top: 20),
                    width: double.infinity,
                    height: 50,
                    decoration: BoxDecoration(
                        border: Border.all(color: Colors.black, width: 2),
                        borderRadius: BorderRadius.circular(10)),
                    child: TextField(
                      controller: password,
                      maxLines: 1,
                      obscureText: true,
                      decoration: InputDecoration(
                          hintText: '请输入你的密码',
                          border: InputBorder.none,
                          contentPadding: EdgeInsets.fromLTRB(10, 12, 0, 10),
                          suffixIcon: Icon(
                            Icons.lock_outline,
                            size: 24,
                          )),
                      style: TextStyle(fontSize: 18),
                      cursorHeight: 24,
                    ),
                  ),
                  Container(
                    margin: EdgeInsets.only(top: 20),
                    width: double.infinity,
                    height: 50,
                    decoration: BoxDecoration(
                        border: Border.all(color: Colors.black, width: 2),
                        borderRadius: BorderRadius.circular(10)),
                    child: TextField(
                      obscureText: true,
                      controller: confirm,
                      maxLines: 1,
                      decoration: InputDecoration(
                          hintText: '请再次输入你的密码',
                          border: InputBorder.none,
                          contentPadding: EdgeInsets.fromLTRB(10, 12, 0, 10),
                          suffixIcon: Icon(
                            Icons.lock_outline,
                            size: 24,
                          )),
                      style: TextStyle(fontSize: 18),
                      cursorHeight: 24,
                    ),
                  ),
                  Container(
                    margin: EdgeInsets.only(top: 20),
                    width: double.infinity,
                    height: 50,
                    child: TextButton(
                      onPressed: () async {
                        if (RegExp(
                            "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*\$")
                            .hasMatch(email.text.trim())) {
                          ResultEntity resultEntity = await API().register(
                              UserEntity().fromJson({
                                "email": email.text.trim(),
                                "password": password.text.trim()
                              }));
                          if (resultEntity.code == 200) {
                            Fluttertoast.showToast(
                                msg: "注册成功", gravity: ToastGravity.BOTTOM);
                            Navigator.pop(context, ResultEntity.success(null));
                          } else {
                            Fluttertoast.showToast(
                                msg: resultEntity.message,
                                gravity: ToastGravity.BOTTOM);
                          }
                          // Navigator.of(context).pop(resultEntity);
                        } else {
                          Fluttertoast.showToast(
                              msg: "邮箱格式错误", gravity: ToastGravity.BOTTOM);
                        }
                      },
                      child: Text(
                        '登录',
                        style: TextStyle(color: Colors.white, fontSize: 20),
                      ),
                      style: ButtonStyle(
                        shape: MaterialStateProperty.resolveWith((states) {
                          return new RoundedRectangleBorder(
                              borderRadius: new BorderRadius.circular(10.0));
                        }),
                        backgroundColor:
                        MaterialStateProperty.resolveWith((states) {
                          return Color(0xFF00B6FF);
                        }),
                      ),
                    ),
                  ),
                  GestureDetector(
                    onTap: () {
                      Navigator.pop(context);
                    },
                    child: Container(
                      margin: EdgeInsets.only(top: 10),
                      child: Text('I already have an account',
                          style:
                          TextStyle(decoration: TextDecoration.underline)),
                    ),
                  )
                ],
              ),
            ),
            shape: RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(29.0))),
          );
        });
  }

  static Future<bool> collectionConfirmDialog(BuildContext context,
      {bool choose}) async {
    choose ??= false;
    return showDialog<bool>(
        context: context,
        barrierDismissible: true,
        builder: (_) =>
            StatefulBuilder(
                builder: (_, stateSetter) =>
                    AlertDialog(
                        title: Center(
                          child: Text(
                            'Informed Consent Form for Experimental Participants',
                            style: TextStyle(
                                fontWeight: FontWeight.w900, fontSize: 20),
                          ),
                        ),
                        content: Column(
                          mainAxisAlignment: MainAxisAlignment.start,
                          mainAxisSize: MainAxisSize.min,
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Text(
                              'Please read the following information carefully before you sign to participate in the experiment.',
                              style: TextStyle(
                                color: Colors.black45,
                              ),
                            ),
                            Text.rich(TextSpan(children: [
                              TextSpan(
                                  text: 'Purpose:',
                                  style: TextStyle(
                                      fontWeight: FontWeight.bold)),
                              TextSpan(
                                  text:
                                  'You have been asked to participate in a research study that focuses on analyzing emotional data on videos in speech contest. We would like your permission to enroll you as a participant in this research study.'),
                            ])),
                            Expanded(
                                child: SingleChildScrollView(
                                  child: Column(
                                    children: [
                                      Text.rich(TextSpan(children: [
                                        TextSpan(
                                            text: 'Procedure: ',
                                            style: TextStyle(
                                                fontWeight: FontWeight.bold)),
                                        TextSpan(
                                            text:
                                            'Your video in the speech contest will be collected, including the recorded video and audio. You only need to send the recording to us. For a comprehensive analysis, other information like gender, age, region, mother language will also be collected. Subsequent research will first extract the emotional information from the collected video and audio, and then analyze based on this information with other collected data.'),
                                      ])),
                                      Text.rich(TextSpan(children: [
                                        TextSpan(
                                            text: 'Risks and Discomforts: ',
                                            style: TextStyle(
                                                fontWeight: FontWeight.bold)),
                                        TextSpan(text: 'None.'),
                                      ])),
                                      Text.rich(TextSpan(children: [
                                        TextSpan(
                                            text: 'Benefits: ',
                                            style: TextStyle(
                                                fontWeight: FontWeight.bold)),
                                        TextSpan(
                                            text:
                                            'There is no other direct benefit of your participation in this experiment. However, research in this area may eventually be helpful for you to understand your own speech data and applying the research results.')
                                      ])),
                                      Text.rich(TextSpan(children: [
                                        TextSpan(
                                            text: 'Confidentiality: ',
                                            style: TextStyle(
                                                fontWeight: FontWeight.bold)),
                                        TextSpan(
                                            text:
                                            'The results of this study may be published in an academic journal/book, published as an online database for academics or used for teaching purposes. However, your name or other identifiers will not be used in any publication or teaching materials without your specific permission.'),
                                      ])),
                                      Text.rich(TextSpan(children: [
                                        TextSpan(
                                            text: 'Withdraw from the research: ',
                                            style: TextStyle(
                                                fontWeight: FontWeight.bold)),
                                        TextSpan(
                                            text:
                                            'Participation is voluntary, refusal to take part in the study involves no penalty or loss of benefits to which participants are otherwise entitled, and participants may withdraw from the study at any time without penalty or loss of benefits to which they are otherwise entitled.'),
                                      ])),
                                    ],
                                  ),
                                )),
                            CheckboxListTile(
                              value: choose,
                              onChanged: (b) {
                                stateSetter(() {
                                  choose = b;
                                });
                              },
                              dense: true,
                              title: Text(
                                  'I confirm that the purpose of the research, the study procedures and the possible risks and discomforts as well as potential benefits that I may experience have been explained to me. All my questions have been satisfactorily answered. I have read this consent form. Choosing the left box indicates my willingness to participate in this study'),
                            ),
                            Row(
                              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                              children: [
                                MaterialButton(
                                  height: 49,
                                  minWidth: 105,
                                  elevation: 0,
                                  textColor: Colors.white,
                                  color: Color(0xFF7484F4),
                                  shape: RoundedRectangleBorder(
                                      side: BorderSide.none,
                                      borderRadius:
                                      BorderRadius.all(Radius.circular(50))),
                                  onPressed: () {
                                    Navigator.of(context).pop(true);
                                  },
                                  child: Text(
                                    'SUBMIT',
                                    style: TextStyle(fontSize: 16),
                                  ),
                                ),
                                Container(
                                  height: 40,
                                  width: 100,
                                  child: OutlineButton(
                                    borderSide:
                                    BorderSide(width: 2, color: Colors.blue),
                                    textColor: Colors.blue,
                                    color: Colors.white,
                                    shape: RoundedRectangleBorder(
                                        side: BorderSide.none,
                                        borderRadius:
                                        BorderRadius.all(Radius.circular(50))),
                                    onPressed: () {
                                      Navigator.of(context).pop(false);
                                    },
                                    child: Text(
                                      'CANCEL',
                                      style: TextStyle(fontSize: 16),
                                    ),
                                  ),
                                )
                              ],
                            ),
                          ],
                        ))));
  }

  static Future<bool> annotationConfirmDialog(BuildContext context,
      {bool choose}) async {
    choose = false;
    return showDialog<bool>(
      context: context,
      barrierDismissible: true,
      builder: (_) =>
          StatefulBuilder(
            builder: (_, stateSetter) =>
                AlertDialog(
                  title: Center(
                    child: Text(
                      'Informed Consent Form for Experimental Participants',
                      style: TextStyle(
                        fontWeight: FontWeight.w900,
                        fontSize: 20,
                      ),
                    ),
                  ),
                  content: Column(
                    mainAxisAlignment: MainAxisAlignment.start,
                    mainAxisSize: MainAxisSize.min,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text(
                        'Please read the following information carefully before you sign to participate in the experiment.',
                        style: TextStyle(color: Colors.black45),
                      ),
                      Expanded(
                          child: SingleChildScrollView(
                            child: Column(
                              children: [
                                Text.rich(TextSpan(children: [
                                  TextSpan(
                                      text: 'Purpose: ',
                                      style: TextStyle(
                                          fontWeight: FontWeight.bold)),
                                  TextSpan(
                                      text:
                                      'You have been asked to participate in a research study that focuses on annotating emotional data on videos in speech contest. We would like your permission to enroll you as a participant in this research study.'),
                                ])),
                                Text.rich(TextSpan(children: [
                                  TextSpan(
                                      text: 'Procedure: ',
                                      style: TextStyle(
                                          fontWeight: FontWeight.bold)),
                                  TextSpan(
                                      text:
                                      'In the experiment, you will watch the speech video for the first time consecutively, without pre-understanding the content and emotional elements of the speech video. After the end of the viewing, you will mark the emotional factors of the speech video, including the emotional factors of the whole and part of the speech, so as to collect the emotions you perceive when watching videos in a speech contest. For the comprehensiveness of the analysis, your gender, age, education, region, native language and other information will also be collected. Your data will be used as an annotation to the emotional information in both audio and video, which will be analyzed together with other data.'),
                                ])),
                                Text.rich(TextSpan(children: [
                                  TextSpan(
                                      text: 'Risks and Discomforts: ',
                                      style: TextStyle(
                                          fontWeight: FontWeight.bold)),
                                  TextSpan(text: 'None.'),
                                ])),
                                Text.rich(TextSpan(children: [
                                  TextSpan(text: 'Benefits: '),
                                  TextSpan(
                                      text:
                                      'There is no other direct benefit of your participation in this experiment. However, research in this area may eventually be helpful for you to understand your own speech data by applying the research result as a response of this research.')
                                ])),
                                Text.rich(TextSpan(children: [
                                  TextSpan(
                                      text: 'Confidentiality: ',
                                      style: TextStyle(
                                          fontWeight: FontWeight.bold)),
                                  TextSpan(
                                      text:
                                      'The results of this study may be published in an academic journal/book, published as an online database for academics or used for teaching purposes. However, your name or other identifiers will not be used in any publication or teaching materials without your specific permission.'),
                                ])),
                                Text.rich(TextSpan(children: [
                                  TextSpan(
                                      text: 'Withdraw from the research: ',
                                      style: TextStyle(
                                          fontWeight: FontWeight.bold)),
                                  TextSpan(
                                      text:
                                      'Participation is voluntary, refusal to take part in the study involves no penalty or loss of benefits to which participants are otherwise entitled, and participants may withdraw from the study at any time without penalty or loss of benefits to which they are otherwise entitled.'),
                                ])),
                              ],
                            ),
                          )),
                      CheckboxListTile(
                        value: choose,
                        onChanged: (b) {
                          stateSetter(() {
                            choose = b;
                          });
                        },
                        dense: true,
                        title: Text(
                            'I confirm that the purpose of the research, the study procedures and the possible risks and discomforts as well as potential benefits that I may experience have been explained to me. All my questions have been satisfactorily answered. I have read this consent form. Choosing the left box indicates my willingness to participate in this study'),
                      ),
                      Row(
                        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                        children: [
                          MaterialButton(
                            height: 49,
                            minWidth: 105,
                            elevation: 0,
                            textColor: Colors.white,
                            color: Color(0xFF7484F4),
                            shape: RoundedRectangleBorder(
                                side: BorderSide.none,
                                borderRadius:
                                BorderRadius.all(Radius.circular(50))),
                            onPressed: () {
                              Navigator.of(context).pop(true);
                            },
                            child: Text(
                              'SUBMIT',
                              style: TextStyle(fontSize: 16),
                            ),
                          ),
                          Container(
                            height: 40,
                            width: 100,
                            child: OutlineButton(
                              borderSide:
                              BorderSide(width: 2, color: Colors.blue),
                              textColor: Colors.blue,
                              color: Colors.white,
                              shape: RoundedRectangleBorder(
                                  side: BorderSide.none,
                                  borderRadius:
                                  BorderRadius.all(Radius.circular(50))),
                              onPressed: () {
                                Navigator.of(context).pop(false);
                              },
                              child: Text(
                                'CANCEL',
                                style: TextStyle(fontSize: 16),
                              ),
                            ),
                          )
                        ],
                      ),
                    ],
                  ),),),);
  }

  Future<ResultEntity> speechTheme(BuildContext context) {
    return showDialog<ResultEntity>(
        context: context,
        builder: (_) {
          return ChangeNotifierProvider(
            create: (_) => UploadViewModel(),
            child: Consumer<UploadViewModel>(
              builder: (_, model, child) =>
                  AlertDialog(
                    title: Text('Speech Theme'),
                    content: Container(
                      width: 650,
                      height: 480,
                      child: SingleChildScrollView(
                        child: Container(
                          child: Column(
                            crossAxisAlignment: CrossAxisAlignment.start,
                            children: [
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Action',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Action (incl. drive, ambition,risk taking)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Authenticity',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Authenticity (incl. individuality,self-expression)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Balance',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Balance',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Calm',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Calm (incl. tranquillity)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Charity',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Charity (incl. generosity, sharing, benevolence)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Companionship',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Companionship (incl.friendship)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Compassion',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Compassion (incl. understanding, acceptance, tolerance,\n empathy, warmth, caring)',
                                        style: TextStyle(fontSize: 20),
                                        maxLines: 2,
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Connectedness',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Connectedness (incl. cooperation, community)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Contentment',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Contentment',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Confidence',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Confidence (incl. assertiveness)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Courage',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Courage (incl. valor, bravery)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Creativity',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Creativity (incl. ingenuity,originality)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Curiosity',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Curiosity (incl. learning)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Forgiveness',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Forgiveness (incl. mercy)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Gratitude',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Gratitude (incl. politeness,courtesy)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Honesty',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Honesty (incl. integrity,sincerity)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Humility',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Humility (incl. modesty,discretion)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Humor',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Humor (incl. joyfulness)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Justice',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Justice (incl. fairness,impartiality)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Knowledge',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Knowledge (incl. wisdom,perspective)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Leadership',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Leadership',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Love',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Love (incl. kindness, appreciation, faithfulness, loyalty,devotion)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Mindfulness',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Mindfulness (incl. perspective,presence, silence)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Optimism',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Optimism (incl. hopefulness,enthusiasm, positivity)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Perseverance',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Passion (incl. enthusiasm,vitality)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              Container(
                                margin: EdgeInsets.only(right: 10),
                                child: Row(
                                  mainAxisSize: MainAxisSize.min,
                                  children: [
                                    Container(
                                      child: Radio(
                                        value: 'Perseverance',
                                        groupValue: model.theme,
                                        onChanged: (value) =>
                                            model.changeTheme(value),
                                      ),
                                    ),
                                    Container(
                                      child: Text(
                                        'Perseverance (incl. resilience,persistence, industrious)',
                                        style: TextStyle(fontSize: 20),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                            ],
                          ),
                        ),
                      ),
                    ),
                    actions: [
                      TextButton(
                        onPressed: () {
                          Navigator.pop(
                              context, ResultEntity.success(model.theme));
                        },
                        child: Text(
                          '确认',
                          style: TextStyle(color: Colors.white, fontSize: 20),
                        ),
                        style: ButtonStyle(
                          shape: MaterialStateProperty.resolveWith((states) {
                            return new RoundedRectangleBorder(
                                borderRadius: new BorderRadius.circular(10.0));
                          }),
                          backgroundColor:
                          MaterialStateProperty.resolveWith((states) {
                            return Color(0xFF00B6FF);
                          }),
                        ),
                      ),
                      TextButton(
                        onPressed: () {
                          model.theme = null;
                          Navigator.pop(context, ResultEntity.error(500, "取消"));
                        },
                        child: Text(
                          '取消',
                          style: TextStyle(color: Colors.white, fontSize: 20),
                        ),
                        style: ButtonStyle(
                          shape: MaterialStateProperty.resolveWith((states) {
                            return new RoundedRectangleBorder(
                                borderRadius: new BorderRadius.circular(10.0));
                          }),
                          backgroundColor:
                          MaterialStateProperty.resolveWith((states) {
                            return Color(0xFF00B6FF);
                          }),
                        ),
                      ),
                    ],
                  ),
            ),
          );
        });
  }

/*  Future<ResultEntity> speechTags(BuildContext context) {
    return showDialog<ResultEntity>(
        context: context,
        builder: (_) {
          return ChangeNotifierProvider(
            create: (_) => UploadViewModel(),
            child: Consumer<UploadViewModel>(
              builder: (_, model, child) => AlertDialog(
                title: Text('Speech Theme'),
                content: Container(
                  width: 650,
                  height: 480,
                  child: SingleChildScrollView(
                    child: Container(
                      child: Column(
                        crossAxisAlignment: CrossAxisAlignment.start,
                        children: [
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Action',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Action (incl. drive, ambition,risk taking)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Authenticity',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Authenticity (incl. individuality,self-expression)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Balance',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Balance',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Calm',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Calm (incl. tranquillity)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Charity',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Charity (incl. generosity, sharing, benevolence)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Companionship',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Companionship (incl.friendship)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Compassion',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Compassion (incl. understanding, acceptance, tolerance,\n empathy, warmth, caring)',
                                    style: TextStyle(fontSize: 20),
                                    maxLines: 2,
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Connectedness',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Connectedness (incl. cooperation, community)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Contentment',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Contentment',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Confidence',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Confidence (incl. assertiveness)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Courage',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Courage (incl. valor, bravery)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Creativity',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Creativity (incl. ingenuity,originality)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Curiosity',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Curiosity (incl. learning)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Forgiveness',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Forgiveness (incl. mercy)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Gratitude',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Gratitude (incl. politeness,courtesy)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Honesty',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Honesty (incl. integrity,sincerity)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Humility',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Humility (incl. modesty,discretion)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Humor',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Humor (incl. joyfulness)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Justice',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Justice (incl. fairness,impartiality)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Knowledge',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Knowledge (incl. wisdom,perspective)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Leadership',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Leadership',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Love',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Love (incl. kindness, appreciation, faithfulness, loyalty,devotion)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Mindfulness',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Mindfulness (incl. perspective,presence, silence)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Optimism',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Optimism (incl. hopefulness,enthusiasm, positivity)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Perseverance',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Passion (incl. enthusiasm,vitality)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                          Container(
                            margin: EdgeInsets.only(right: 10),
                            child: Row(
                              mainAxisSize: MainAxisSize.min,
                              children: [
                                Container(
                                  child: Radio(
                                    value: 'Perseverance',
                                    groupValue: model.theme,
                                    onChanged: (value) =>
                                        model.changeTheme(value),
                                  ),
                                ),
                                Container(
                                  child: Text(
                                    'Perseverance (incl. resilience,persistence, industrious)',
                                    style: TextStyle(fontSize: 20),
                                  ),
                                ),
                              ],
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                ),
                actions: [
                  TextButton(
                    onPressed: () {
                      Navigator.pop(context, ResultEntity.success(model.theme));
                    },
                    child: Text(
                      '确认',
                      style: TextStyle(color: Colors.white, fontSize: 20),
                    ),
                    style: ButtonStyle(
                      shape: MaterialStateProperty.resolveWith((states) {
                        return new RoundedRectangleBorder(
                            borderRadius: new BorderRadius.circular(10.0));
                      }),
                      backgroundColor:
                      MaterialStateProperty.resolveWith((states) {
                        return Color(0xFF00B6FF);
                      }),
                    ),
                  ),
                  TextButton(
                    onPressed: () {
                      model.theme = null;
                      Navigator.pop(context, ResultEntity.error(500, "取消"));
                    },
                    child: Text(
                      '取消',
                      style: TextStyle(color: Colors.white, fontSize: 20),
                    ),
                    style: ButtonStyle(
                      shape: MaterialStateProperty.resolveWith((states) {
                        return new RoundedRectangleBorder(
                            borderRadius: new BorderRadius.circular(10.0));
                      }),
                      backgroundColor:
                      MaterialStateProperty.resolveWith((states) {
                        return Color(0xFF00B6FF);
                      }),
                    ),
                  ),
                ],
              ),
            ),
          );
        });
}*/
}